/* 
 * File:   QualityMeasurer.h
 * Author: Guilherme Monteiro
 *
 */

#ifndef QUALITYMEASURERTT_H
#define	QUALITYMEASURERTT_H

#include <vector>

#include "../../TableTranscriber2/headers/Cell.h"
#include "../../TableTranscriber2/headers/Reader.h"
#include "MetricsVectorTT.h"
#include <dirent.h>

#define OUTPUT_FILE string("qualityAnalysis/qmtt.csv")
#define FIELD_SEPARATOR string(",")

using namespace std;

/**
 * Class whose responsibility is make the
 * estimation of the quality of transcription
 * of the tables by the heuristic of the TableTranscriber.
 * 
 * The selection of the better model is made by the user and
 * the control about the files by the external system.
 * 
 */
class QualityMeasurerTT {
public:
    QualityMeasurerTT();
    QualityMeasurerTT(const QualityMeasurerTT& orig);
    virtual ~QualityMeasurerTT();
    void run();
private:
    File* file;
    
    void writeFile(MetricsVectorTT* vec);
    
    vector<string> getBookNames();
    vector<string> getUserAnswersPaths(string book);
    vector<string> getSoftAnswersPaths(string book);
    
    void writeHeaderOutputFile();
    string getPageName(string userAnsPath);
    vector< pair<string,string> > loadPairs(vector<string> softAnsPaths, vector<string> userAnsPaths);
    int getIndexOfCorrespondentAnswer(string uAnswerPath, vector<string> softAnswersPaths);
};

#endif	/* QUALITYMEASURERTT_H */

